]> dgit.raspbian.org Git - libreoffice.git/commitdiff
[PATCH] put slideshow media links under link control
authorCaolán McNamara <caolan.mcnamara@collabora.com>
Tue, 14 Jul 2026 18:12:01 +0000 (19:12 +0100)
committerRene Engelhard <rene@debian.org>
Sat, 3 Oct 2026 10:46:08 +0000 (12:46 +0200)
Change-Id: I22b8e5577e2a450d0d4043db891eec4617dcb2fe
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/7009
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit f0768394c14f928d47547408fc1195368be81f86)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208332
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208391
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Hossein <hossein@libreoffice.org>
Gbp-Pq: Name CVE-2026-63269-3.diff

slideshow/source/engine/shapes/viewmediashape.cxx
slideshow/source/engine/shapes/viewmediashape.hxx

index ec19f11b66f8db47ca1fa7a57cb660843a524c21..1f45f25ae2ba5f85738598b5b44bc727e19ffe74 100644 (file)
@@ -39,6 +39,7 @@
 #include <cppcanvas/canvas.hxx>
 #include <avmedia/mediawindow.hxx>
 #include <svx/svdobj.hxx>
+#include <svx/svdmodel.hxx>
 #include <svx/svdomedia.hxx>
 
 #include <com/sun/star/awt/XWindow.hpp>
@@ -267,6 +268,21 @@ namespace slideshow::internal
         }
 
 
+        bool ViewMediaShape::implMediaLinkAllowed() const
+        {
+            SdrObject* pObj = SdrObject::getSdrObjectFromXShape(mxShape);
+            if (!pObj)
+                return false;
+            uno::Reference<beans::XPropertySet> xModelProps(
+                pObj->getSdrModelFromSdrObject().getUnoModel(), uno::UNO_QUERY);
+            if (!xModelProps.is())
+                return false;
+            bool bAllow = false;
+            xModelProps->getPropertyValue(u"AllowLinkUpdate"_ustr) >>= bAllow;
+            return bAllow;
+        }
+
+
         bool ViewMediaShape::implInitialize( const ::basegfx::B2DRectangle& rBounds )
         {
             if( !mxPlayer.is() && mxShape.is() )
@@ -294,7 +310,8 @@ namespace slideshow::internal
                             {
                                 implInitializeMediaPlayer( aURL, sMimeType );
                             }
-                            else if (xPropSet->getPropertyValue(u"MediaURL"_ustr) >>= aURL)
+                            else if ((xPropSet->getPropertyValue(u"MediaURL"_ustr) >>= aURL)
+                                     && implMediaLinkAllowed())
                             {
                                 if ( maFallbackDir.getLength() &&
                                      aURL.startsWith("file:///") &&
index 34be8536b73be669464c5eaa444c001f09065e43..3631e35b1ec9c57d51519a1a6627584bad7dad15 100644 (file)
@@ -144,6 +144,7 @@ namespace slideshow::internal
         private:
 
             bool implInitialize( const ::basegfx::B2DRectangle& rBounds );
+            bool implMediaLinkAllowed() const;
             void implSetMediaProperties( const css::uno::Reference< css::beans::XPropertySet >& rxProps );
             void implInitializeMediaPlayer( const OUString& rMediaURL, const OUString& rMimeType );
             void implInitializePlayerWindow( const ::basegfx::B2DRectangle& rBounds,